<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['数据统计','运载趟数统计']" icon="fa fa-area-chart" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>运载趟数统计</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
								<button type="button" class="btn btn-primary" (click)="export_totle(exportModal)">导出</button>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号码</th>
										<th>设备ID</th>
										<th>所属公司</th>
										<th>装载时间</th>
										<th>卸载时间</th>
										<th>重量(吨)</th>
										<th>运输时间（分钟）</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.startLoadingTime}}</td>
										<td>{{row.endDischargingtime}}</td>
										<td>{{row.weight}}</td>
										<td>{{row.transportationTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 数据导出    弹窗-->
	<div bsModal #exportModal="bs-modal" id="exportDateModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="cancelExport(exportModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">数据导出</h4>
				</div>
				<div class="modal-body">
					<div class="row form-horizontal" style="margin-left:20px">
						<div class="line">
							<span class="text">文件类型</span>
							<label class="radio radio-inline">
		                        <input type="radio" class="radiobox" [(ngModel)]='fileType' (change)="fileTypeChange($event.target.value)" value="pdf" name="pdf">
		                        <span>PDF文件</span>
		                    </label>
		                    <label class="radio radio-inline">
		                        <input type="radio" class="radiobox" [(ngModel)]='fileType' (change)="fileTypeChange($event.target.value)" value="excel" name="excel">
		                        <span>EXCEL文件</span>
		                    </label>
	                    </div>
	                    
	                    <div class="line" style="margin-bottom: 6px;">
							<span class="text" style="width: 132px;"></span>
							<label class="radio radio-inline" style="margin-right: 40px;">
		                        <input type="radio" class="radiobox" [(ngModel)]='modalType' (change)="modalTypeChange($event.target.value)" value='1' name="modal1">
		                        <span>模式一</span>
		                    </label>
		                    <label class="radio radio-inline" style="margin-right: 40px;">
		                        <input type="radio" class="radiobox" [(ngModel)]='modalType' (change)="modalTypeChange($event.target.value)" value='2' name="modal2">
		                        <span>模式二</span>
		                    </label>
		                    <label class="radio radio-inline" style="margin-right:0;">
		                        <input type="radio" class="radiobox" [(ngModel)]='modalType' (change)="modalTypeChange($event.target.value)" value='3'name='modal3'>
		                        <span>自定义</span>
		                    </label>
	                    </div>
	                    <div class="line" style="position: relative;">
	                    	<span class="text" style="position: relative;top: -60px;">工作时间</span>
		                    <div class="s_time_module" [ngClass]="{modalActive:modalType === '1'}" (click)="activeModal('1')">
		                    	<ul>
		                    		<li class="s_lis">0 - 8</li>
		                    		<li class="s_lis">8 - 16</li>
		                    		<li class="s_lis">16 - 0(+1天)</li>
		                    	</ul>
		                    </div>
		                    <div class="s_time_module" [ngClass]="{modalActive:modalType === '2'}" (click)="activeModal('2')">
		                    	<ul>
		                    		<li class="s_lis">6 - 18</li>
		                    		<li class="s_lis">18 - 6(+1天)</li>
		                    	</ul>
		                    </div>
		                    <div class="s_time_module" [ngClass]="{modalActive:modalType === '3'}" (click)="activeModal('3')">
		                    	<ul>
		                    		<li class="input_lis" *ngFor="let item of selfTimeList;let i = index">
		                    			<div class="input_box">
		                    				<input type="text" name="" placeholder="请选择" [attr.id]="item.index" onfocus="this.blur()" (click)="isShowTimer(item.index)" (blur)="timeBlur(item)" [(ngModel)]='item.selfTime' value="" class="s_input"/>
		                    				<div class="s_del_icon" (click)='delSelfTime(item.index)'>x</div>
		                    			</div>
		                    		</li>
		                    	</ul>
		                    	<button class="btn btn-primary" (click)="addSelfTime()" style="padding: 2px 4px;min-width: 60px;margin-left: 12px;font-size: 12px;">+添加</button>
		                    </div>
		                    
		                    <div class="s_timePicker" id="s_timePicker">
		                    	<div class="s_arrow"></div>
		                    	<div class="s_start">
		                    		<p class="s_title">开始时间<span>-[<span style="color: #1A6DDD;font-size: 14px;"> {{startTimeSelected}} </span>]</span></p>
		                    		<div class="s_border_box">
		                    			<ul>
		                    				<li class="s_lis" *ngFor="let item of hourList" (click)="selectedTime(item.index,'start')">{{item.index}}</li>
		                    			</ul>
		                    		</div>
		                    	</div>
		                    	<div class="s_end">
		                    		<p class="s_title">结束时间<span>-[<span style="color: #1A6DDD;font-size: 14px;"> {{endTimeSelected}} </span>]</span></p>
		                    		<div class="s_border_box">
		                    			<ul>
		                    				<li class="s_lis" *ngFor="let item of hourList" (click)="selectedTime(item.index,'end')">{{item.index}}</li>
		                    			</ul>
		                    		</div>
		                    	</div>
		                    	<div class="s_time_footer">
		                    		<button class="btn btn-default" (click)="cancelTimePicker()" style="padding: 4px 12px;min-width: 40px;">取消</button>
		                    		<button class="btn btn-primary s_btn_primary" (click)="submitTimerSelected()" style="padding: 4px 12px;min-width: 40px;">确认</button>
		                    	</div>
		                    </div>
	                    </div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="cancelExport(exportModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="exportSubmit(exportModal)">导出</button>
				</div>
			</div>
		</div>
	</div>
	<!--数据导出 end-->
</div>